package com.gzhryc.shared_device.oem.code.agent.dao.db;

import com.gzhryc.jdbc.annotaion.Column;
import com.gzhryc.jdbc.annotaion.Join;
import com.gzhryc.jdbc.annotaion.PrimaryKey;
import com.gzhryc.jdbc.annotaion.Table;
import com.gzhryc.shared_device.oem.code.business.EFuncModelShowState;
import com.gzhryc.shared_device.oem.code.config.dao.db.FuncModel;

import java.util.Date;

/**
 * 用户功能模块
 * @version 2023-01-31
 */
@Table(name="agent_func_model")
public class AgentFuncModel {

    @PrimaryKey
    @Column(name = "user_id", notNull = true)
    protected Long userId;

    @PrimaryKey
    @Column(name = "func_model_id", notNull = true)
    protected Long funcModelId;

    @Column(notNull = true, defVal = "1", note = "状态")
    private Integer state;

    @Column(name = "update_date", autoUpdateTime = true)
    protected Date updateDate;

    @Column(name = "create_date")
    protected Date createDate;

    @Join(fromField = "func_model_id")
    protected FuncModel funcModel;

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getFuncModelId() {
        return funcModelId;
    }

    public void setFuncModelId(Long funcModelId) {
        this.funcModelId = funcModelId;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public FuncModel getFuncModel() {
        return funcModel;
    }

    public void setFuncModel(FuncModel funcModel) {
        this.funcModel = funcModel;
    }

    public String getStateName(){
        return EFuncModelShowState.note(this.state);
    }
}
